package com.glepoch.springbootsecuritymybatis.mappper.user;

import com.glepoch.springbootsecuritymybatis.bean.Role;
import com.glepoch.springbootsecuritymybatis.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface UserMapper {
    @Select("select * from user where username=#{username}")
    User loadUserByUsername(String username);
    @Select("select r.* from role r join user_role ur on r.id=ur.rid where uid=#{uid}")
    List<Role> getRoleById(Long uid);

    List<User> selectUserPage(User user);
}
